About Picture Shapes
A picture shape represents a collection of other shapes. For example, you could create a scroll bar using a picture shape:
Using picture shapes, you can create complex graphics, create shapes with both graphic and typographic content, combine multiple bitmaps into a single shape, create groups of shapes, create shape layers, group shapes into pages to prepare for printing, and so on.
- You could create separate polygon shapes to represent the scroll box, the gray area, and the two scroll arrows.
- You could then collect these individual polygon shapes into a single picture shape to represent the entire scroll bar.
Like any QuickDraw GX shape, a picture shape is represented in memory by a shape object, a style object, an ink object, and a transform object. A shape object representing a picture shape contains the same properties as a shape object representing a geometric or a typographic shape: owner count, tag list, shape type, shape fill, geometry, and so on.
Since picture shapes contain other shapes, they don't make much use of their shape fill property, although you can specify a no-fill shape fill if you don't want the picture to appear when drawn.
Picture shapes also don't make much use of their associated style object, since each shape in the picture has its own style object.
Pictures shapes also don't make much use of their ink objects for the same reasons.
Picture shapes do make full use of their transform objects, however. For example, you can scale, skew, rotate, and clip picture shapes as a whole, as well as separately for each individual shape in the picture. This process is described in more detail in the section "Transform Concatenation" beginning on page 6-19.
Picture shapes differ from other types of shapes primarily in the content of their geometries. A picture shape's geometry contains a list of picture items. Each picture item contains a reference to another shape.
Although each of the shapes in a picture has its own style, ink, and transform object, picture shapes allow you to provide an overriding style, ink, and transform object for each of these shapes. QuickDraw GX uses this overriding information only when drawing the picture. Even after you insert a shape into a picture, you can still draw the original shape using its original style, ink, and transform object.
Overriding objects are described in the next section "Overriding Styles, Inks, and Transforms" beginning on page 6-8.
Figure 6-1 shows a graphic representation of a picture shape and a picture geometry.
Figure 6-2 shows a single picture item. This item contains a reference to a shape object, which contains a reference to its associated style, ink, and transform objects. These objects are shown in grey, because the picture item also contains references to an overriding style, ink, and transform object for the shape.
Figure 6-3 shows an example of a picture shape with a geometry that contains two picture items. Each item contains a reference to a shape, but neither item contains a reference to an overriding style, ink, or transform object. Therefore, when QuickDraw GX draws this picture, it draws each shape in the picture using the style, ink, and transform information originally associated with the shape, as shown at the bottom of Figure 6-3.
Figure 6-3 A picture geometry with two items
Notice that QuickDraw GX draws the shapes in a picture in the order the references to them appear in the picture geometry: from back to front.
Figure 6-3 shows the entire shape object and picture geometry for the picture shape. Figure 6-4 shows a condensed view of the same picture. This chapter uses condensed views of picture shapes when drawing picture hierarchies, which are described in "Picture Hierarchies" beginning on page 6-18.
Figure 6-4 Condensed view of picture with two items
Subtopics
- Overriding Styles, Inks, and Transforms
- Multiple References
- Unique Items Shape Attribute
- Picture Hierarchies
- Transform Concatenation
- About Hit-Testing Picture Shapes